home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++,comp.lang.eiffel,comp.object,comp.arch
- Path: vixen.cso.uiuc.edu!uchinews!news
- From: Bob Hathaway <rjh@geodesic.com>
- Subject: Re: Real OO
- X-Nntp-Posting-Host: ford.uchicago.edu
- Message-ID: <Dq54Ko.8Ku@midway.uchicago.edu>
- Keywords: function
- Sender: news@midway.uchicago.edu (News Administrator)
- Organization: Geodesic Systems
- References: <65lDeVZF3RB@herold.franken.de> <4kbl7r$1i8@gaia.ns.utk.edu> <4ke84h$iiv@watnews1.watson.ibm.com> <jgkDpzFnD.KL7@netcom.com>
- Date: Sat, 20 Apr 1996 03:05:12 GMT
-
- In article <jgkDpzFnD.KL7@netcom.com>, Joe Keane <jgk@netcom.com> wrote:
- >In article <4kbl7r$1i8@gaia.ns.utk.edu>
- >Matt Kennel <mbk@caffeine.engr.utk.edu> writes:
- >>My experience with Sather numerical classes is that the cost of
- >>indirect calls is not the actual indirection, but the lost
- >>opportunities for inlining.
- >
- >In article <4ke84h$iiv@watnews1.watson.ibm.com>
- >Norman H. Cohen <ncohen@watson.ibm.com> writes:
- >>Plus the opportunities that arise from cross-procedural analysis, for
- >>compilers that perform such analysis for statically bound subprograms.
- >>
- >>(But remember, in counting the cost of the actual indirection, to count
- >>machine cycles rather than instruction path length. Indirect function
- >>calls can cause expensive I-cache misses on some architectures.)
- >
- >Ding ding ding! People too often concentrate on the number of
- >instructions to just do the function call, either static or virtual.
- >
- >In my experience that's not the thing; rather it's that when you inline
- >a function the compiler has much more oppurtunity for optimization.
- >This comes from a variety of reasons, and i'm convinced that in real
- >situations this is more important than a couple cycles to jump.
-
- Ding ding ding! In my experience that's not the thing; rather it's that when
- you design software it reflects your model properly and supports the best
- polymorphic model. Efficiency comes after effectiveness as long as the
- time constraint requirements are met. And computer speeds are getting
- faster all the time - the last time I checked the speed of a PC they ran
- at about 200Mz - no reason to stop optimizing though.
-
- Also, interprocedural analysis can do this too without increasing static
- code size (Time/Space opt). But you're right that if the function *really*
- can't be determined then things like DU chains get cut for conservatism,
- as in object code libraries.
-
- >If the function being called isn't known at compile time, the compiler
- >must assume the worst, even though it's quite likely that the function
- >will turn out to be something very simple.
-
- There are optimizations for multiple-polymorphism that can turn these
- inherent typed calls into inlines. Check the comp.object FAQ for references.
- I think it covers this issue, as I wrote it!
-
- Best Regards,
- Bob
-